package com.asyf.shoporder.service;

import com.asyf.shopcommon.Product;
import com.asyf.shoporder.service.impl.ProductServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author yjz
 * @Date 2022/9/7 22:20
 */
@FeignClient(value = "service-product", fallback = ProductServiceFallBack.class)//声明调用的提供者的name
public interface ProductService {

    //指定调用提供者的哪个方法
    //@FeignClient+@GetMapping 就是一个完整的请求路径 http://service-product/product/{pid}
    @GetMapping(value = "/product/{pid}")
    Product findByPid(@PathVariable("pid") Integer pid);
}
